var ProStockInfoModel = function (order, stock) {
  BaseModel.call(this);

  var self = this;
  var fn = {
    initData: function (order, stock) {
      self.setDataFromObj(order, ['materialCode']);

      self.totalCount = stock.productionUnitFeedCount;
      var orderDetail = stock.orderDetail;
      if (orderDetail !== null) {
        var orderSize = orderDetail.klccSize;
        if (orderSize === null || orderSize === '') {
          orderSize = '无';
        }
        self.orderSize = orderSize;
      }

      var orderDetailList = stock.returnOrderDetailList;
      var detailList = [];
      var len = orderDetailList.length;
      for (var i = 0; i < len; i++) {
        var detail = orderDetailList[i];
        var klccSize = detail.klccSize;
        if (klccSize === undefined || klccSize === null || klccSize === '') {
          continue;
        }
        detailList.push({
          size: klccSize
        });
      }

      detailList = _.uniqBy(detailList, 'size');
      if (detailList.length === 0) {
        detailList = [{
          size: '无'
        }];
      }
      self.detailList = detailList;
    }
  };

  fn.initData(order, stock);
};